package com.martin.dms.dataservices;

import java.util.List;

import com.martin.dms.model.DMSObject;

/**
 * DMS data service for a DMS entity object.
 * 
 * @author mtsvetkov
 * 
 * @param <T> - The entity DMS object.
 */
public interface DMSDataService<T extends DMSObject> {

    /**
     * Creates a new DMS object in the DB.
     * 
     * @param dmsObject - the DMS to persist.
     * @return the new DMS object.
     */
    public T create(T dmsObject);

    /**
     * Gets the DMS object that corresponds to the given id.
     * 
     * @param id - the id of the DMS object.
     * @return a DMS object.
     */
    public T get(long id);

    /**
     * Gets all DMS objects of the given type T.
     * 
     * @return a list that contains the DMS objects.
     */
    public List<T> getAll();

    /**
     * Deletes the DMS object that corresponds to the given id.
     * 
     * @param id - the id of the DMS object.
     */
    public void delete(long id);
}
